<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人主页-魔步网</title>
<?php include_once(VIEWPATH."public/header_title.php");?>
<link href="<?php echo _get_cfg_path('css')?>base.css" type="text/css" rel="stylesheet" />
<link href="<?php echo _get_cfg_path('css')?>common.css" type="text/css" rel="stylesheet" />
<link href="<?php echo _get_cfg_path('lib')?>uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<!--[if IE 6]>
<script src="<?php echo _get_cfg_path('js')?>DD_belatedPNG.js" type="text/javascript" ></script>
<script>DD_belatedPNG.fix('a,img');</script>
<![endif]-->
</head>
<body>
<?php include_once(VIEWPATH."public/header.php");?>
<div class="mainbody" id="mainbody">
	<div class="introd container">
        
<?php include_once(VIEWPATH."i/public/top.php");?>  
<div class="schedule clearfix">
            <div class="clearfix">
                <div class="time_top">
                    <form action="" method="post">
                        <input type="hidden" name="y" id="y" value="<?=$YM['y']?>">
                        <input type="hidden" name="m" id="m" value="<?=$YM['m']?>">
                        <div class="time">
                            <span id="total_nian"><?=$YM['y']?>.</span><span id="total_yue"><?=$YM['m']?></span>
                        </div>
                        <div class="nianyue fr">
                            <div class="time_select" id="nian"><?=$YM['y']?>年</div>
                            <div class="time_select_click"><i></i></div>
                            <div class="select" id="nianfen" style="display: none;">
                                <ul>
                                  <?php $thatY = date("Y",$oUser['addtime']);
                                   for($i=(date("Y")+1);$i>( $thatY>(date("Y")-9)?$thatY:(date("Y")-9) );$i--){?>
                                  <li><?=$i?>年</li>
                                  <?php }?>
                                </ul>
                            </div>
                            <div class="time_select" id="yue"><?=$YM['m']?>月</div>
                            <div class="time_select_click"><i></i></div>
                            <div class="select" id="yuefen">
                                <ul>
                                  <li>01月</li>
                                  <li>02月</li>
                                  <li>03月</li>
                                  <li>04月</li>
                                  <li>05月</li>
                                  <li>06月</li>
                                  <li>07月</li>
                                  <li>08月</li>
                                  <li>09月</li>
                                  <li>10月</li>
                                  <li>11月</li>
                                  <li>12月</li>
                                </ul>
                            </div>
                        </div>
                        <!--nianyue-->
                        <button type="submit" class="time_select_button" style="display:none;"></button>
                    </form>
                </div>
            </div>
            <div class="piao_list">
                <div class="piao_con_tit">
                    <ul>
                        <li>星期日</li>
                        <li>星期一</li>
                        <li>星期二</li>
                        <li>星期三</li>
                        <li>星期四</li>
                        <li>星期五</li>
                        <li>星期六</li>
                    </ul>
                </div>

                <?php
                        
            $now_year=$YM['y'];//取得年份
            $now_mondy=$YM['m'];//取得月份
            $now_date=$now_year.'-'.$now_mondy;
            if($now_mondy==02){
              if($now_year%4==0 && ($now_year%100!=0 || $now_year%400==0)){$mondy_total=29;}
              else{$mondy_total=28;}
            }
            elseif($now_mondy==01||$now_mondy==03||$now_mondy==05||$now_mondy==07||$now_mondy==08||$now_mondy==10||$now_mondy==12){$mondy_total=31;}//取得月份中的日起数
            else{$mondy_total=30;}
              $date_first=date("w",strtotime($now_date."-01"));//第一天的日期
            if(($date_first>4&&$mondy_total==31)||($date_first>5&&$mondy_total==30)){$total_num=42;}
            else{$total_num=35;}//判断总共有多少个显示日期的格子
                    ?>
                    <div class="piao_con">
                      <div style="float:left;width:740px; margin-top:1px;display:none"></div>
                      <?php 
            for($i=0;$i<$total_num;$i++){
              $the_date=$YM['y'].'-'.str_pad($YM['m'],2,"0",STR_PAD_LEFT).'-'.str_pad(($i-$date_first+1),2,"0",STR_PAD_LEFT);//得到完整日期
              if($i%7==0)
                   echo '<div class="con_day">';
              ?>
                <?php $arrItem = array('class'=>'','title'=>'','dayno'=>'','date'=>'');
                  if($i%2==1)
                    $arrItem['class'] = ' bg_day';

                  if($i>=$date_first && $i-$date_first<$mondy_total)
                    $arrItem['dayno']='<p class="d_number">'.($i-$date_first+1).'</p>';

                  $tmp_title='';
                  $title = '';
                  $flag = 0;
                  $flag_str = '';
                  //已有预约
                  foreach ($list['rows'] as $key => $a) {
                      // 预约时间
                      $startTime = strtotime(date('Y-m-d', $a['datetime']));
                      if (empty($a['endtime'])) {
                          // 结束时间
                          $endTime = strtotime(date('Y-m-d', $a['datetime']));
                      } else {
                          $endTime = strtotime(date('Y-m-d', $a['endtime']));
                      }
                      // 表格时间
                      $theTime = strtotime($the_date);
                      
                      // 
                      if ((($startTime == $theTime) or ($startTime < $theTime)) AND 
                           (($endTime == $theTime) or ($endTime > $theTime)))
                      {

                        $HI = '';
//                         if( $a['endtime']>$a['datetime'] &&   $a['endtime']-$a['datetime'] <24*60*60 )
//                         {
//                           $HI =date('H:i',$a['datetime']);
//                           $HI .='-'.date('H:i',$a['endtime']);
//                         }
                        $title = $a['type']==1?'努力工作中':'休息中';//strlen($a['title'])<=30 ? $a['title'] : substr($a['title'],0,30).'..';
                        //$tmp_title.='<p class="arr_con">'.$title.'<i>'.$HI.'</i></p>';

                        if ($a['time_zone'] === 0 || $a['time_zone'] == '0')
                        {
                        	$tmp_title .= '<p>全天</p>';
                        	$flag = 3;
                        	$flag_str .= '_hole';
                        }
                        elseif ($a['time_zone'] == 1)
                        {
                        	$tmp_title .= '<p>上午</p>';
                        	$flag += 1;
                        	$flag_str .= '_morning';
                        }
                        elseif ($a['time_zone'] == 2)
                        {
                        	$tmp_title .= '<p>下午</p>';
                        	$flag += 1;
                        	$flag_str .= '_afternoon';
                        }
                        else
                        {
                        	$tmp_title .= '<p>晚上</p>';
                        	$flag += 1;
                        	$flag_str .= '_night';
                        }
                      }
                  }
                  if ($title) {
                  	$tmp_title ='<p class="arr_con">'.$title.'<i>'.$HI.'</i></p>'.$tmp_title;
                  }
                  if(!empty($tmp_title) && $flag >= 3){
                    $arrItem['class'].=' teba_kan';
                    $arrItem['title']='<div class="arrang">'.$tmp_title.'</div>';
                  }
                  elseif ($flag != 0 && $flag < 3 && strtotime($the_date)>time())
                  {
                  	$arrItem['class'].=' d_reser';
                  	$arrItem['title']='<div class="arrang">'.$tmp_title.'</div>';
                  	$arrItem['date']=' _date='.$the_date.' id='.$the_date;
                  }
                  elseif(!empty($arrItem['dayno']) && strtotime($the_date)>time())
                  {
                    $arrItem['class'].=' d_reser';
                    $arrItem['title']='<i class="res_b"></i><p class="res_zi">有空哦，快来预约</p>';
                    $arrItem['date']=' _date='.$the_date.' id='.$the_date;
                  }
                ?>
                        
                      <input type="hidden" value="<?=$flag?>" id="<?$i?>_flag"/>    
                      <div class="day<?=$arrItem['class']?>"<?=$arrItem['date']?> data-flag="<?=$flag?>" data-flag-str="<?=$flag_str?>">
                        <?=$arrItem['dayno']?>
                        <?=$arrItem['title']?>
                      </div>

                <?php
                if($i%7==6)
                  echo '</div>';
            }
            ?>
                 
                </div>
            </div>
            <?php 
                if ($now_mondy < 10)
                    $next_month = '0'.($now_mondy+1);
                else 
                    $next_month = $now_mondy+1;
            ?>
            <div style="text-align:right;font-size:15px;font-family:'Microsoft Yahei';"><a href="/i/schedule/<?=$oUser['id']?>?month=<?=$next_month?>">>>下个月</a></div>
        </div>
      <div _date="2017-05-27" data-flag='1'></div>
    </div>
</div>
<!--mainbody-->
<?php include_once(VIEWPATH."public/footer.php");?>

<input type="hidden" id="login_userid" value="<?=$this->loginID?>"/>
<div class="popover-mask"></div>
<div class="popover" style="width:730px;">
  <div class="poptit"> <a href="javascript:;" title="关闭" class="close">×</a></div>
  <div class="popbod">
      <div class="fl popimg"><img src="<?php echo _get_cfg_path('images')?>mt_12.jpg"/></div>
      <div class="fr poptab" style="width:400px;padding:0;padding-top:5px;padding-left:10px;">
        <form id="xtform" method="post" action="/i/schedule/book">
          <input type="hidden" name="booked_userid" value="<?=_get_key_val($oUser['id'])?>" />
          <input type="hidden" name="begtime" id="begtime" value=""/>
          <input type="hidden" name="endtime" id="endtime" value=""/>
          <input type="hidden" name="price" id="price" value=""/>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="80"><font>价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 格：</font></td>
                  <td><span class="moneysign"></span> <em class="money price">面议</em></td>
                </tr>
                <tr>
                  <td><font><?=$item_label?>：</font></td>
                  <td>
                    <select name="item" id="item" class="txt sele">
                        <?php foreach ($oItemList as $k => $v):?>
                        <option value="<?=$k?>"><?=$v?></option>
                        <?php endforeach;?>
                    </select>
                  </td>
                </tr>
                <?php if ($oSceneList):?>
                <tr>
                  <td><font><?=$scene_label?>：</font></td>
                  <td>
                     <div class="clearfix scene XT-Scene">
                        <?php foreach ($oSceneList as $k => $v):?>
                         <a href="javascript:;" onclick="filt(this)" name="<?=$k?>"><?=$v?></a>
                        <?php endforeach;?>
                        <input name="scene" id="scene" value="0" type="hidden">
                     </div> 
                  </td>
                </tr>
                <?php endif;?>
                <tr>
                  <td><font>计价方式：</font></td>
                  <td>
                      <div class="clearfix scene XT-Time">
                        <?php foreach ($oTimeList as $k => $v):?>
                          <a href="javascript:;" onclick="filt(this)" name="<?=$k?>"><?=$v?></a>
                        <?php endforeach;?>
                        <input name="time" id="time" value="0" type="hidden">
                      </div>
                  </td>
                </tr>
                <?php if ($oUser['usertype']==1):?>
                    <?php if ($oShoottypeList):?>
                    <tr>
                      <td><font>工作形式：</font></td>
                      <td>
                          <div class="clearfix scene XT-shoottype">
                            <?php foreach ($oShoottypeList as $k => $v):?>
                              <a href="javascript:;" onclick="filt(this)" name="<?=$k?>"><?=$v?></a>
                            <?php endforeach;?>
                            <input name="shoottype" id="shoottype" value="0" type="hidden">
                          </div>
                      </td>
                    </tr>
                    <?php endif;?>
                    <tr id="work_remark_tr" style="display:none;">
                      <td><font>工作备注：</font></td>
                      <td>
                          <!-- <div class="clearfix" id="work_remark" style="width:84%;">
                          </div> -->
                          <textarea class="txt text" id="work_remark" name="remark" cols="" rows="" readonly="true" style="height:50px;"></textarea>
                      </td>
                    </tr>
                <?php endif;?>
                <tr>
                  <td><font>时间/数量：</font></td>
                  <td>
                    <div class="i_tips" style="display:none"></div>
                    <div class="i_box">
                        <a href="javascript:;" class="J_minus">-</a>
                        <input type="text" value="1" class="J_input" name="num" id="num" />
                        <a href="javascript:;" class="J_add">+</a>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td><font>工作地点：</font></td>
                  <td>
                    <div class="i_tips" style="display:none"></div>
                    <div class="i_box">
                        <input type="text" class="txt" name="work_place" id="work_place" placeholder="工作地点" style="text-align:left;font-size:12px;"/>
                    </div>
                  </td>
                </tr>
                <tr>
                   <td valign="top"><font>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注：</font></td>
                   <td><textarea class="txt text" name="remark" cols="" rows="" style="height:30px;"></textarea></td>
                </tr>
                <tr>
                  <td><font>拍片日期：</font></td>
                  <td>
                  	<span id="time_zone_select">
                  		<select name="time_zone" class="txt time_zone_select" style="width:60px;">
                  			<option value=""></option>
                  			<option class="hole_date" value="0">全天</option>
                  			<option class="morning_date part_time" value="1">上午</option>
                  			<option class="afternoon_date part_time" value="2">下午</option>
                  			<option class="night_date part_time" value="3">晚上</option>
                  		</select>
                  	</span>
                  	<span id="more_date_option">
                  		<input type="text" id="start_date" value="" disabled="disabled" class="txt" style="width:100px;"/>至
                  		<input type="text" id="end_date" class="txt" value="" placeholder="例：2016-08-14" onclick="J.calendar.get();" style="width:100px;"/>
                  	</span>
                  </td>
                  <!-- <td><span id="photo_date"></span></td> -->
                </tr>
                <tr>
                  <td><font>联&nbsp;系&nbsp;&nbsp;人：</font></td>
                  <td><input class="txt" name="linkman" id="linkman" type="text" value="<?php if($this->loginID>0) echo $this->loginNickName;?>"/></td>
                </tr>
                <tr>
                  <td><font>联系方式：</font></td>
                  <td><input class="txt" name="linkway" id="linkway" type="text" value="<?php if($this->loginUser) echo $this->loginUser['mobile'];?>"/></td>
                </tr>
                <tr><td height="25" colspan="2" id="err-message" class="main_color"></td></tr>
                <tr>
                   <td colspan="2"><input class="but" name="" id="XT-Book" type="button" value="立即下单"/></td>
                </tr>
                <tr>
                    <td colspan="2" style="padding-top: 8px;">
                        <a class="work_model_pdf" href="javascript:void(0);">《魔步网工作规范协议（模特）》</a>
                        <a class="work_customer_pdf" href="javascript:void(0);">《魔步网工作规范协议（客户）》</a>
                    </td>
                </tr>
            </table>
          </form>
        </div>
  </div>
  <script type="text/javascript">
  var arrProduct = new Array();
  var arrRemark = new Array();
  <?php $i = 0;
   foreach ($oProductList as $k => $v):
      $i++;?>
    arrProduct[<?=$i?>]=["<?=$k?>","<?=$v?>"];
    arrRemark[<?=$i?>]="<?=$workRemark[$k]?>";
  <?php endforeach;?>

  var arrIST = new Array();
  <?php foreach ($oItem_Scene_Time as $k => $a):

          $tmp=''; 
          foreach($a as $kk=>$aa){
            $time_list='';
            foreach ($aa['time_list'] as $kkk => $aaa) {
              $time_list.='{k:'.$kkk.',name:"'.$aaa.'"},';
            }
            $time_list=trim($time_list,',');
            $tmp.='{k:'.$aa['scene_key'].',name:"'.$aa['scene_name'].'",tim:['.$time_list.']},';
          }
          $tmp=trim($tmp,',');
    ?>
    arrIST[<?=$k?>]=[<?=$tmp;?>];
  <?php endforeach;?>
  var arrShoot = new Array();
  var i = 0;
  <?php 
     $tmp = '';
     if ($shootList){
         foreach ($shootList as $k=>$v)
         {
             $shoStr='';
             if ($v)
             {
                 foreach ($v as $key=>$val)
                 {
                     $shoStr.= '{id:'.$val['key'].',value:"'.$val['value'].'"},';
                 }
             }
             $shoStr = trim($shoStr,',');
             $tmp='{k:"'.$k.'",shoots:['.$shoStr.']}';
         ?>
         i++;
         arrShoot[i]=[<?=$tmp?>];
         <?php
         }
     }
  ?>
  </script>
</div>
</body>

<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>pages/i/schedule.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>main.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>jquery.form.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>Quantity.js"></script>

<script type="text/javascript" src="<?php echo _get_cfg_path('lib')?>datepicker/lhgcore.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('lib')?>datepicker/lhgcalendar.js"></script>
<script>
  	$(function(){
  	  	$("#start_date").click(function(){
  	  	  	$('iframe').css('position','fixed');
  	  	});

  	  	//预约条款
	  	$(".work_model_pdf").click(function(){
	  		window.open("../../assets/src/pdf/魔步网工作规范协议（模特）.pdf","TencentLogin","width=600,height=500,menubar=0,scrollbars=1, resizable=1,status=1,titlebar=0,toolbar=0,location=1");
	  	});
	  	$(".work_customer_pdf").click(function(){
	  		window.open("../../assets/src/pdf/魔步网工作规范协议（客户）.pdf","TencentLogin","width=600,height=500,menubar=0,scrollbars=1, resizable=1,status=1,titlebar=0,toolbar=0,location=1");
	  	});
  	});
</script>
<script>
/* 置顶 */
$(function(){
	  //首先将#back-to-top隐藏
	  $("#totop").hide();
	  //当滚动条的位置处于距顶部100像素以下时，跳转链接出现，否则消失
	  $(function(){
		  $(window).scroll(function(){
			  if ($(window).scrollTop()>300){
				  $("#totop").fadeIn();
			  }else{
				  $("#totop").fadeOut();
			  }
		  });
		  //当点击跳转链接后，回到页面顶部位置
		  $("#totop").click(function(){
			  $('body,html').animate({scrollTop:0},300);
			  return false;
		  });

		  //微信二维码
		  $(".wx_qrcode").hide();
			$(".f_weixin,.wx_qrcode").hover(function(){
				$(".wx_qrcode").show();
			},function(){
				$(".wx_qrcode").hide();
			})
	  });

	  //个人页面菜单效果
	  $(".memu_but,.memu_list").hover(function(){
			$(".memu_list").show();
		},function(){
			$(".memu_list").hide();
		});
});
</script>
</html>